<!DOCTYPE html>
<html>
<head>
    <title>K线练习</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
    <div class="toolbar">
        <button id="drawLine">画线</button>
        <button id="addText">添加文字</button>
    </div>
    <canvas id="practiceChart" width="800" height="400"></canvas>
    <script>
        // 练习模式交互逻辑
    </script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>K线练习 - K线训练营平台</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        .navbar {
            background-color: #333;
            overflow: hidden;
            padding: 10px 20px;
        }
        .navbar a {
            float: left;
            color: white;
            text-align: center;
            padding: 12px 16px;
            text-decoration: none;
            font-size: 17px;
        }
        .navbar a:hover {
            background-color: #ddd;
            color: black;
        }
        .user-info {
            float: right;
            color: white;
            padding: 12px 16px;
        }
        .content {
            padding: 20px;
        }
        h1 {
            color: #333;
        }
        .controls {
            margin: 20px 0;
        }
        button {
            padding: 10px 15px;
            margin-right: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <div class="navbar">
        <a href="/">首页</a>
        <a href="/practice">K线练习</a>
        <a href="#">数据管理</a>
        <div class="user-info">
            {% if 'username' in session %}
                欢迎, {{ session['username'] }} | <a href="/logout" style="color: white;">退出</a>
            {% else %}
                <a href="/login" style="color: white;">登录</a> | <a href="/register" style="color: white;">注册</a>
            {% endif %}
        </div>
    </div>
    
    <div class="content">
        <h1>K线练习模式</h1>
        <div class="controls">
            <button id="buy-btn">买入</button>
            <button id="sell-btn">卖出</button>
            <button id="reset-btn">重置</button>
        </div>
        {{ plot_div|safe }}
    </div>
</body>
</html>